# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=gpaste
pkgver=3.26.0
pkgrel=1
pkgdesc="Clipboard management system"
url="http://www.imagination-land.org/tags/GPaste.html"
license=(BSD)
arch=(i686 x86_64)
depends=(gtk3)
makedepends=(intltool vala appstream-glib gobject-introspection gnome-shell gnome-control-center git)
optdepends=("wgetpaste: Upload clipboard contents")
options=(!emptydirs)
_commit=d064ab11e51f56caa32a21a5784b7580ee570303  # tags/v3.26.0^0
source=("git+https://github.com/keruspe/gpaste#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --libexecdir=/usr/lib --sysconfdir=/etc \
    --enable-vala
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check () {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
